package com.itheima.day01.ZuoYe.ZuoYe3_6;

import java.util.ArrayList;

public class Test {
    public static void main(String[] args) {
        SUV s1 = new SUV(1000,3000,"sq");
        SUV s2 = new SUV(2000,1000,"s1");
        SUV s3 = new SUV(2000,4000,"s3");
        SUV s4 = new SUV(2000,5000,"s4");
        SUV s5 = new SUV(2000,6000,"s5");
        ArrayList <SUV>list = new ArrayList();
        list.add(s1);
        list.add(s2);
        list.add(s3);
        list.add(s4);
        list.add(s5);
        for (int i = 0; i < list.size(); i++) {
            if (list.get(i).compare() == 3) {
                System.out.println(list.get(i).getBrand()+"\t"+list.get(i).getPrice()+"\t"+list.get(i).getLength());
            }
        }
    }

}
